<?php
$criteria = new CDbCriteria;
$criteria->group = 'ip';
$criteria->distinct = True;
$rows = count(Counter::model()->findAll($criteria));
$criteria = new CDbCriteria;
$criteria->condition = "error = 1";
$errows = count(Counter::model()->findAll($criteria));
$count = Counter::model()->count();
?>
<table>
    <tr>
        <td>Всего переходов</td>
        <td><?php echo $count ?></td>
    </tr>
    <tr>
        <td>Всего уников</td>
        <td><?php echo $rows ?></td>
    </tr>
    <tr>
        <td>Обращений на несуществующие линьки</td>
        <td><?php echo $errows ?>
    </tr>
</table>
<table width="90%">
    <tr>
    <form method="POST">
        <td style="width: 15%"><input type="text" name="date" value="<?php echo $inf['date']?>"/></td>
        <td style="width: 10%"><input type="text" name="ip" value="<?php echo $inf['ip']?>"/></td>
        <td style="width: 70%"><input type="text" name="page" value="<?php echo $inf['page']?>"/><input type="submit" name="search" value="Искать"/></td>
        <td></td>
    </form>
</tr>
<tr>
    <td style="width: 15%">Время</td>
    <td style="width: 10%">ip</td>
    <td style="width: 60%">Страница</td>
    <td></td>
</tr>
<?php $this->widget('zii.widgets.CListView', array(
        'dataProvider'=>$dataProvider,
        'itemView'=>'_view',
)); ?>
</table>